package server;

import java.rmi.Naming;
import java.rmi.registry.LocateRegistry;

import controller.ISistema;
import controller.Sistema;

public class Server {

	public static void main(String[] args) {
		new Server();
	}

	public Server() {
		System.out.println("Iniciando Instancia");
		iniciar();

	}

	private void iniciar() {
		try {
			
			//System.setSecurityManager(new RMISecurityManager());
			
			LocateRegistry.createRegistry(1099);
			ISistema sistema = (ISistema) Sistema.getInstancia();
			Naming.rebind("//localhost/Sistema", sistema);
			System.out.println("Sistema :Fijado en //localhost/Sistema");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
